Get OS X Version via Command Line

Get OS X Version

returns 10.7.2:

:::bash
sw_vers -productVersion

returns 7:

:::bash
sw_vers -productVersion | awk -F. `{ print $2 }`

Tags: